package com.ruoyi.know.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;

/**
 * 笔记对象 notes
 *
 * @author ruoyi
 * @date 2025-02-09
 */
public class Notes extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 笔记id */
    private Long noteId;

    /** 知识点id */
    @Excel(name = "知识点id")
    private Long knowledgePointId;

    /** 所属用户id */
    @Excel(name = "所属用户id")
    private Long userId;

    private SysUser sysUser;

    //收藏数量
    private Integer favoritesNum;

    //点赞数量
    private Integer likeNum;

    //评论数量
    private Integer commentNum;

    /**
     * 是否已经点赞
     */
    private boolean isLike;

    private boolean collected;

    /** 笔记标题 */
    @Excel(name = "笔记标题")
    private String noteTitle;

    /** 笔记内容 */
    @Excel(name = "笔记内容")
    private String noteContent;

    /** 是否公开：0否 1是 */
    @Excel(name = "是否公开：0否 1是")
    private Long isVisibility;

    /** 附件地址 */
    @Excel(name = "附件地址")
    private String attachUrl;

    /** 是否有效：0无效1有效 */
    private Long isValid;

    /** 创建人 */
    private String createdBy;

    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date createdAt;

    /** 更新时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date updatedAt;

    //  只参与SQL倒叙条件
    private String descBy;

    public void setNoteId(Long noteId)
    {
        this.noteId = noteId;
    }

    public Long getNoteId()
    {
        return noteId;
    }
    public void setKnowledgePointId(Long knowledgePointId)
    {
        this.knowledgePointId = knowledgePointId;
    }

    public Long getKnowledgePointId()
    {
        return knowledgePointId;
    }
    public void setUserId(Long userId)
    {
        this.userId = userId;
    }

    public Long getUserId()
    {
        return userId;
    }
    public void setNoteTitle(String noteTitle)
    {
        this.noteTitle = noteTitle;
    }

    public SysUser getSysUser() {
        return sysUser;
    }

    public void setSysUser(SysUser sysUser) {
        this.sysUser = sysUser;
    }

    public String getNoteTitle()
    {
        return noteTitle;
    }
    public void setNoteContent(String noteContent)
    {
        this.noteContent = noteContent;
    }

    public Integer getFavoritesNum() {
        return favoritesNum;
    }

    public void setFavoritesNum(Integer favoritesNum) {
        this.favoritesNum = favoritesNum;
    }

    public Integer getLikeNum() {
        return likeNum;
    }

    public boolean isLike() {
        return isLike;
    }

    public void setLike(boolean like) {
        isLike = like;
    }

    public boolean isCollected() {
        return collected;
    }

    public void setCollected(boolean collected) {
        this.collected = collected;
    }

    public Integer getLikeNum(int countByLikes) {
        return likeNum;
    }

    public void setLikeNum(Integer likeNum) {
        this.likeNum = likeNum;
    }

    public Integer getCommentNum() {
        return commentNum;
    }

    public void setCommentNum(Integer commentNum) {
        this.commentNum = commentNum;
    }

    public String getNoteContent()
    {
        return noteContent;
    }
    public void setIsVisibility(Long isVisibility)
    {
        this.isVisibility = isVisibility;
    }

    public Long getIsVisibility()
    {
        return isVisibility;
    }
    public void setAttachUrl(String attachUrl)
    {
        this.attachUrl = attachUrl;
    }

    public String getAttachUrl()
    {
        return attachUrl;
    }
    public void setIsValid(Long isValid)
    {
        this.isValid = isValid;
    }

    public Long getIsValid()
    {
        return isValid;
    }
    public void setCreatedBy(String createdBy)
    {
        this.createdBy = createdBy;
    }

    public String getCreatedBy()
    {
        return createdBy;
    }
    public void setCreatedAt(Date createdAt)
    {
        this.createdAt = createdAt;
    }

    public Date getCreatedAt()
    {
        return createdAt;
    }
    public void setUpdatedAt(Date updatedAt)
    {
        this.updatedAt = updatedAt;
    }

    public Date getUpdatedAt()
    {
        return updatedAt;
    }

    public String getDescBy() {
        return descBy;
    }

    public void setDescBy(String descBy) {
        this.descBy = descBy;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("noteId", getNoteId())
            .append("knowledgePointId", getKnowledgePointId())
            .append("userId", getUserId())
            .append("noteTitle", getNoteTitle())
            .append("noteContent", getNoteContent())
            .append("isVisibility", getIsVisibility())
            .append("attachUrl", getAttachUrl())
            .append("isValid", getIsValid())
            .append("createdBy", getCreatedBy())
            .append("createdAt", getCreatedAt())
            .append("updateBy", getUpdateBy())
            .append("updatedAt", getUpdatedAt())
            .append("descBy", getDescBy())
            .toString();
    }
}
